home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 January / 1991-01.d64 / 64 mlx (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  103 lines

  1. 10 rem version 1.1: lines 830,950 modified, lines 485-487 added
  2. 100 poke 56,50:clr:dim in$,i,j,a,b,a$,b$,a(7),n$
  3. 110 c4=48:c6=16:c7=7:z2=2:z4=254:z5=255:z6=256:z7=127
  4. 120 fa=peek(45)+z6*peek(46):bs=peek(55)+z6*peek(56):h$="0123456789abcdef"
  5. 130 r$=chr$(13):l$="[157]":s$=" ":d$=chr$(20):z$=chr$(0):t$=""
  6. 140 sd=54272:for i=sd to sd+23:poke i,0:next:poke sd+24,15:poke 788,52
  7. 150 print"[147]"chr$(142)chr$(8):poke 53280,15:poke 53281,15
  8. 160 print t$"   [164][164][164][164][164][164][164][164]  "spc(28)"  [146] mlx ii   "spc(28)"            "
  9. 170 print"   compute!'s machine language editor"
  10. 180 print"[144]starting address[151]";:gosub300:sa=ad:gosub1040:if f then180
  11. 190 print"[144]  ending address[151]";:gosub300:ea=ad:gosub1030:if f then190
  12. 200 input"[144]clear workspace [y/n][151]";a$:if left$(a$,1)<>"y"then220
  13. 210 print"working...";:fori=bs to bs+ea-sa+7:poke i,0:next:print"done"
  14. 220 printtab(10)"[144] mlx command menu [151]":print t$"e[146]nter data"
  15. 230 print t$"d[146]isplay data":print t$"l[146]oad file"
  16. 240 print t$"s[146]ave file":print t$"q[146]uit[144]"
  17. 250 get a$:if a$=n$ then250
  18. 260 a=0:for i=1 to 5:if a$=mid$("edlsq",i,1)then a=i:i=5
  19. 270 next:on a goto420,610,690,700,280:gosub1060:goto250
  20. 280 print" quit ":input"[151]are you sure [y/n]";a$:if left$(a$,1)<>"y"then220
  21. 290 poke sd+24,0:end
  22. 300 in$=n$:ad=0:inputin$:iflen(in$)<>4thenreturn
  23. 310 b$=in$:gosub320:ad=a:b$=mid$(in$,3):gosub320:ad=ad*256+a:return
  24. 320 a=0:for j=1 to 2:a$=mid$(b$,j,1):b=asc(a$)-c4+(a$>"@")*c7:a=a*c6+b
  25. 330 if b<0 or b>15 then ad=0:a=-1:j=2
  26. 340 next:return
  27. 350 b=int(a/c6):print mid$(h$,b+1,1);:b=a-b*c6:print mid$(h$,b+1,1);:return
  28. 360 a=int(ad/z6):gosub350:a=ad-a*z6:gosub350:print":";
  29. 370 ck=int(ad/z6):ck=ad-z4*ck+z5*(ck>z7):goto390
  30. 380 ck=ck*z2+z5*(ck>z7)+a
  31. 390 ck=ck+z5*(ck>z5):return
  32. 400 print"starting at[151]";:gosub300:if in$<>n$ then gosub1030:if f then400
  33. 410 return
  34. 420 print" enter data ":gosub400:if in$=n$ then220
  35. 430 open3,3:print
  36. 440 poke198,0:gosub360:if f then print in$:print"[145]";
  37. 450 for i=0 to 24 step 3:b$=s$:for j=1 to 2:if f then b$=mid$(in$,i+j,1)
  38. 460 print""b$l$;:if i<24then print"[146]";
  39. 470 get a$:if a$=n$ then470
  40. 480 if(a$>"/"anda$<":")or(a$>"@"anda$<"g")then540
  41. 485 a=-(a$="m")-2*(a$=",")-3*(a$=".")-4*(a$="/")-5*(a$="j")-6*(a$="k")
  42. 486 a=a-7*(a$="l")-8*(a$=":")-9*(a$="u")-10*(a$="i")-11*(a$="o")-12*(a$="p")
  43. 487 a=a-13*(a$=s$):if a then a$=mid$("abcd123e456f0",a,1):goto 540
  44. 41451 (NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)poke(NULL)log(NULL)return(NULL)(NULL)(NULL)(NULL)ZO(NULL)(NULL)pos(NULL)qgosubrnd(NULL)(NULL)(NULL):(NULL)(NULL)j(NULL)=(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)for(NULL)(NULL)\(NULL)(NULL)(NULL)(NULL)gosub(NULL)end(NULL)(NULL)(NULL)(NULL)(NULL)u(NULL)(NULL)(NULL)verifyprint#(NULL)verify(NULL)(NULL)(NULL)print#U(NULL)verify(NULL)print#(NULL)(NULL)(NULL)XX(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)print#(NULL)(NULL)(NULL)")[175]f [167][153] b$l$;:[137]540
  45. 520 [139] a$[179][177]l$ [175] a$[179][177]d$ [176]((i[178]0)[175](j[178]1))[167] [141]1060:[137]470
  46. 530 a$[178]l$[170]s$[170]l$:[153] b$l$;:j[178]2[171]j:[139] j [167] [153] l$;:i[178]i[171]3
  47. 540 [153] a$;:[130] j:[153] s$;
  48. 550 [130] i:[153]:[153]"on";:[132]3,in$:[139] in$[178]n$ [167] [160]3:[137]220
  49. 560 [129] i[178]1 [164] 25 [169]3:b$[178][202](in$,i):[141]320:[139] i[179]25 [167] [141]380:a(i[173]3)[178]a
  50. 570 [130]:[139] a[179][177]ck [167] [141]1060:[153]"stop error: reenter line poke":f[178]1:[137]440
  51. 580 [141]1080:b[178]bs[170]ad[171]sa:[129] i[178]0 [164] 7:[151] b[170]i,a(i):[130]
  52. 590 ad[178]ad[170]8:[139] ad[177]ea [167] [160]3:[153]"** end of entry **stop":[137]700
  53. 600 f[178]0:[137]440
  54. 610 [153]"load display data ":[141]400:[139] in$[178]n$ [167]220
  55. 620 [153]"press: spacewait to pause, returnwait to breakpoke"
  56. 630 [141]360:b[178]bs[170]ad[171]sa:[129]i[178]b[164] b[170]7:a[178][194](i):[141]350:[141]380:[153] s$;
  57. 640 [130]:[153]"";:a[178]ck:[141]350:[153]
  58. 650 f[178]1:ad[178]ad[170]8:[139] ad[177]ea [167][153]"** end of data **":[137]220
  59. 660 [161] a$:[139] a$[178]r$ [167] [141]1080:[137]220
  60. 670 [139] a$[178]s$ [167] f[178]f[170]1:[141]1080
  61. 680 [145]f[137]630,660,630
  62. 690 [153]" load data ":op[178]1:[137]710
  63. 700 [153]" save file ":op[178]0
  64. 710 in$[178]n$:[133]"filenamepoke";in$:[139] in$[178]n$ [167]220
  65. 720 f[178]0:[153]"stoptwaitape or dwaitisk: poke";
  66. 730 [161] a$:[139] a$[178]"t"[167] [153]"t":[137]880
  67. 740 [139] a$[179][177]"d"[167]730
  68. 750 [153]"d":[159]15,8,15,"i0:":b[178]ea[171]sa:in$[178]"0:"[170]in$:[139] op [167]810
  69. 760 [159] 1,8,8,in$[170]",p,w":[141]860:[139] a [167]220
  70. 770 ah[178][181](sa[173]256):al[178]sa[171](ah[172]256):[152]1,[199](al);[199](ah);
  71. 780 [129] i[178]0 [164] b:[152]1,[199]([194](bs[170]i));:[139] st [167]800
  72. 790 [130]:[160]1:[160]15:[137]940
  73. 800 [141]1060:[153]"stoperror during save:poke":[141]860:[137]220
  74. 810 [159] 1,8,8,in$[170]",p,r":[141]860:[139] a [167]220
  75. 820 [161]#1,a$,b$:ad[178][198](a$[170]z$)[170]256[172][198](b$[170]z$):[139] ad[179][177]sa [167] f[178]1:[137]850
  76. 830 [129] i[178]0 [164] b:[161]#1,a$:[151] bs[170]i,[198](a$[170]z$):[139](i[179][177]b)[175] st [167] f[178]2:ad[178]i:i[178]b
  77. 840 [130]:[139] st[179][177]64 [167] f[178]3
  78. 850 [160]1:[160]15:[145] [182](f[177]0)[170]1 [137]960,970
  79. 860 [132]15,a,a$:[139] a [167] [160]1:[160]15:[141]1060:[153]"error: "a$
  80. 870 [142]
  81. 880 [151]183,[194](fa[170]2):[151]187,[194](fa[170]3):[151]188,[194](fa[170]4):[139]op[178]0[167]920
  82. 890 [158] 63466:[139]([194](783)[175]1)[167] [141]1060:[153]" file not found ":[137]690
  83. 900 ad[178][194](829)[170]256[172][194](830):[139] ad[179][177]sa [167] f[178]1:[137]970
  84. 910 a[178][194](831)[170]256[172][194](832)[171]1:f[178]f[171]2[172](a[179]ea)[171]3[172](a[177]ea):ad[178]a[171]ad:[137]930
  85. 920 a[178]sa:b[178]ea[170]1:[141]1010:[151]780,3:[158] 63338
  86. 930 a[178]bs:b[178]bs[170](ea[171]sa)[170]1:[141]1010:[145] op [137]950:[158] 63591
  87. 940 [141]1080:[153]"** save completed **":[137]220
  88. 950 [151]147,0:[158] 63562:[139] st[177]0 [167]970
  89. 960 [141]1080:[153]"** load completed **":[137]220
  90. 970 [141]1060:[153]"stoperror during load:poke":[145] f [141]980,990,1000:[137]220
  91. 980 [153]"incorrect starting address (";:[141]360:[153]")":[142]
  92. 990 [153]"load ended at ";:ad[178]sa[170]ad:[141]360:[153] d$:[142]
  93. 1000 [153]"truncated at ending address":[142]
  94. 1010 ah[178][181](a[173]256):al[178]a[171](ah[172]256):[151]193,al:[151]194,ah
  95. 1020 ah[178][181](b[173]256):al[178]b[171](ah[172]256):[151]174,al:[151]175,ah:[142]
  96. 1030 [139] ad[179]sa [176] ad[177]ea [167]1050
  97. 1040 [139] (ad[177]511 [175] ad[179]65280) [167] [141]1080: f[178]0: [142]
  98. 1050 [141]1060:[153]" invalid address stop":f[178]1:[142]
  99. 1060 [151] sd[170]5,31:[151] sd[170]6,208:[151] sd,240:[151] sd[170]1,4:[151] sd[170]4,33
  100. 1070 [129] s[178]1 [164] 100:[130]:[137]1090
  101. 1080 [151] sd[170]5,8:[151] sd[170]6,240:[151] sd,0:[151] sd[170]1,90:[151] sd[170]4,17
  102. 1090 [129] s[178]1 [164] 100:[130]:[151] sd[170]4,0:[151] sd,0:[151] sd[170]1,0:[142]
  103.